<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
		<style type="text/css">
			.box{
				width: 100px;
				height: 100px;
				padding: 10px;
				margin: 10px;
				border: 10px solid #000;
				background-color: pink;
			}
		</style>
	</head>
	<body>
		<div class="box"></div>
		<script type="text/javascript">
			var div = document.getElementsByTagName("div")[0];
			
			//offsetHeight和offsetWidth: 可以检测盒子的宽高
			//包括宽高本身,padding,border.不包括amrgin
			
			//offsetHeight = height+padding+border;(不加margin)
			//offsetWidth = width+padding+border;(不加margin)
			console.log(div.offsetHeight);
			console.log(typeof div.offsetHeight);		//number
		</script>
	</body>
</html>
